var that;
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    list: [{
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/5.jpg',
      text: '0',
      id: 0,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/1.jpg',
      text: '1',
      id: 1,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/2.jpg',
      text: '2',
      id: 2,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/5.jpg',
      text: '3',
      id: 3,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/1.jpg',
      text: '4',
      id: 4,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/2.jpg',
      text: '5',
      id: 5,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/5.jpg',
      text: '6',
      id: 6,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/1.jpg',
      text: '7',
      id: 7,
    }, {
      img: 'http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201801/jiaoben5647/img/2.jpg',
      text: '8',
      id: 8,
    }]
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    that = this;
  },
 
  // 删除
  del(e){
    var list = that.data.list;
    var index = e.currentTarget.dataset.index;
    list.splice(index,1);
 
    that.setData({
      list:list
    });
  },
})
